import vue from "@vitejs/plugin-vue"
import AutoImport from "unplugin-auto-import/vite"
import { AntDesignVueResolver } from "unplugin-vue-components/resolvers"
import Components from "unplugin-vue-components/vite"
import { defineConfig } from "vite"

// https://vite.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    Components({
      resolvers: [
        AntDesignVueResolver({
          importStyle: false, // css in js
        }),
      ],
      dts: "src/typings/components.d.ts",
    }),
    AutoImport({
      imports: [
        "vue",
        "vue-router",
        "pinia",
        {
          "@/stores/modules/app": ["useAppStoreHook", "getThemeTokenHook"],
        },
      ],
      dts: "src/typings/auto-imports.d.ts",
    }),
  ],
  resolve: {
    alias: {
      "@/": "/src/",
    },
  },
  base: "/",
})
